package com.wiscamp.ninechapters.panels.domain.enums;

public enum PermissionTypes {
    None("无", 0),
    Query("查询", 108001),
    Create("创建", 108002),
    Update("修改", 108003),
    Delete("删除", 108004),
    Print("打印", 108005),
    Import("导入  ", 108006),
    Export("导出", 108007),
    Bind("绑定", 108008),
    Unbind("解绑", 108009),
    Others("其它", 108010);

    private String name;
    private int index;

    // 构造方法
    private PermissionTypes(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (PermissionTypes c : PermissionTypes.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
